﻿
using System.Diagnostics;
namespace Aocsoft
{
    public interface ILoggerFactory
    {
        ILogger LoggerFor(string keyName);
        ILogger LoggerFor(System.Type type);
        ILogger GetCurrentClassLogger();
    }

    public abstract class LoggerFactoryBase
    {
        public virtual ILogger GetCurrentClassLogger()
        {
            StackFrame frame = new StackFrame(1, false);
            return LoggerContext.LoggerFactory.LoggerFor(frame.GetMethod().DeclaringType.FullName);
        }
    }
}
